package com.biz.config;

import com.biz.trace.*;
import org.springframework.boot.web.servlet.*;
import org.springframework.context.annotation.*;

import javax.annotation.*;

/**
 * @Description
 *  链路追踪
 * @Author liuxi
 * @Date 2024/5/12
 **/
@Configuration
public class FilterTraceIdConfig {

    @Resource
    private TraceIdFilter traceIdFilter;

    @Bean
    public FilterRegistrationBean registrationFilter() {
        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
        registrationBean.setFilter(traceIdFilter);
        registrationBean.addUrlPatterns("/*");
        registrationBean.setName("traceIdFilter");
        registrationBean.setOrder(1);
        return registrationBean;
    }

}
